<template>
	<router-view v-slot="{ Component }">
		<keep-alive :include="cacheList">
			<component :is="Component" />
		</keep-alive>
	</router-view>
</template>

<script setup>
import { useCacheStore } from '@/store/cache';
import { storeToRefs } from 'pinia'
const cacheStore = useCacheStore()
// 需要缓存的组件列表
const { cacheList } = storeToRefs(cacheStore)
</script>

<style>
@import url("assets/css/reset.css");

#app {
	margin: 0 auto;
	max-width: 750px;
}
</style>